// groupInfo.js
var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
  
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    wx.request({
      url: app.globalData.allUrl + '/YMGW/seckillAction/getOtherInfoOne',
      data: {
        id: options.otherId
      },
      method: 'GET',
      success: function (res) {
        that.setData({
          Object: res.data
        })
      }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  },
  calling: function () {
     var that = this;
     //   console.log(that.data.Object.phone);
     wx.makePhoneCall({
        phoneNumber: that.data.Object.otherPhone, //此号码并非真实电话号码，仅用于测试
        success: function () {
           console.log("拨打电话成功！")
        },
        fail: function () {
           console.log("拨打电话失败！")
        }
     })
  },
  infoImgClick: function (e) {
     var that = e.target.dataset.sum;
   //   console.log(that);
     var objects = this.data.Object;
     var urls = [];
     var str = "https://www.ymg3.com/ymgImage/others/";
     urls.push(str + objects.liveAction);
     urls.push(str + objects.license);
     urls.push(str + objects.identityCardImg);
     wx.previewImage({
        current: urls[that], // 当前显示图片的http链接
        urls: urls
     })
  }

})